package com.ghost.view.UI
{
	import com.ghost.UI.Ghost_Btn;
	import com.ghost.interfaces.Ibaseui;
	import com.ghost.manager.Tip_manager;
	import com.ghost.model.Global_data;
	import com.ghost.view.Base_effect;
	
	import flash.display.Sprite;
	import flash.events.MouseEvent;

	/**
	 * 菜单容器
	 * @author ghost
	 */	
	public class Menu_main extends Base_effect implements Ibaseui
	{
		private var ghost_btn:Ghost_Btn;
		[Embed(source='assets/ui/menu/disable.png',scaleGridLeft="15" , scaleGridRight="46",scaleGridTop="15",scaleGridBottom="46")]
		private var d:Class;
		[Embed(source='assets/ui/menu/over.png',scaleGridLeft="15" , scaleGridRight="46",scaleGridTop="15",scaleGridBottom="46")]
		private var o:Class;
		[Embed(source='assets/ui/menu/click.png',scaleGridLeft="15" , scaleGridRight="46",scaleGridTop="15",scaleGridBottom="46")]
		private var c:Class;
		[Embed(source='assets/ui/menu/out.png',scaleGridLeft="15" , scaleGridRight="46",scaleGridTop="15",scaleGridBottom="46")]
		private var out:Class;
		private var btn_skin_v:Vector.<Class>;
		[Embed(source='assets/ui/menu/all.png')]
		private var all:Class;
		[Embed(source='assets/ui/menu/fashion.png')]
		private var fashion:Class;
		[Embed(source='assets/ui/menu/gift.png')]
		private var gift:Class;
		[Embed(source='assets/ui/menu/mall.png')]
		private var mall:Class;
		[Embed(source='assets/ui/menu/prop.png')]
		private var prop:Class;
		[Embed(source='assets/ui/menu/soilder.png')]
		private var soilder:Class;
		[Embed(source='assets/ui/menu/stuff.png')]
		private var stuff:Class;
		[Embed(source='assets/ui/menu/task.png')]
		private var task:Class;
		[Embed(source='assets/ui/menu/weapon.png')]
		private var weapon:Class;
		private var btn_icon_v:Vector.<Class>;
		private var btn_name_arr:Vector.<String>;
		public function Menu_main()
		{
			btn_name_arr = new <String>["all","fashion","gift","mall","prop","soilder","stuff","task","weapon"];
			btn_skin_v = new Vector.<Class>();
			btn_skin_v.push(d,o,out,c);
			btn_icon_v = new Vector.<Class>();
			btn_icon_v.push(all,fashion,gift,mall,prop,soilder,stuff,task,weapon);
			var i:int = 0;
			for(;i<btn_icon_v.length;i++)
			{
				ghost_btn = new Ghost_Btn(btn_skin_v,call_back);
				ghost_btn.set_icon(btn_icon_v[i]);
				ghost_btn.setsize(61,61);
				this.addChild(ghost_btn);
				ghost_btn.x = i*(ghost_btn.width+2);
				Tip_manager.getInstance().add_tip(ghost_btn,btn_name_arr[i])
			}
		}
		public function hide():void
		{
			this.visible = false;
		}
		public function show():void
		{
			this.visible = true;
		}
		public function reflash_x_y():void
		{
			this.x = Global_data.stage_s_width-this.width;
			this.y = Global_data.stage_s_height-this.height;
			trace(this.y,this.height,888)
		}
		private function call_back(e:MouseEvent):void
		{
			trace(e.target.name,1111);
		}
	}
}